package com.eight.lotteryservice.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.eight.lotteryservice.entity.RedUser;
import com.eight.lotteryservice.service.RedUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author eight
 * @since 2022-08-20
 */
@RestController
@RequestMapping("/lotteryservice/red-user")
@CrossOrigin
public class RedUserController {

    @Autowired
    private RedUserService redUserService;

    @Autowired
    private RedisTemplate redisTemplate;

    @GetMapping("find")
    public List<RedUser> findAll(){
        List<RedUser> list = redUserService.list(null);
        for(RedUser user:list){
            System.out.println(user.getId());
        }
        return list;
    }
    @GetMapping("test")
    public void test1(){
        redisTemplate.opsForValue().set("linxin","123");
    }

}

